import request from '@/utils/request'
import { type Result } from '@/types/result'

// 新增收藏
export function addProductCollectApi(productId: string): Promise<Result> {
  return request.post('/productCollect/add', { productId })
}

// 查询商品是否被收藏
export function getProductIsCollectApi(productId: string): Promise<Result> {
  return request.get(`/productCollect/isCollect?productId=${productId}`)
}

// 查询所有收藏
export function getProductCollectListApi(): Promise<Result> {
  return request.get('/productCollect/list')
}

// 删除收藏
export function deleteProductCollectApi(productId: string): Promise<Result> {
  return request.delete(`/productCollect/delete?productId=${productId}`)
}
